package C;

import java.util.Scanner;
import java.util.StringJoiner;


public class C7My {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        System.out.println(getResult(M));
    }
    public static String getResult(int m) {
        if (m>100 || m<=1) return "ERROR";
        CycleLinkedList cl = new CycleLinkedList();
        for (int i=1;i<=100;i++) {
            cl.append(i);
        }
        int num = 1;
        Node cur = cl.head;
        while (cl.size >= m) {
            if (num == m) {
                cur = cl.remove(cur);
                num = 1;
            } else {
                num++;
                cur = cur.next;
            }
        }
        cur = cl.head;
        StringJoiner sj = new StringJoiner(",");
        for (int i=0;i<cl.size;i++) {
            sj.add(String.valueOf(cur.val));
            cur = cur.next;
        }
        return sj.toString();
    }
}
